package my.maven.project.spiderproc.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import my.maven.project.spiderproc.entity.Word;
import my.maven.project.spiderproc.service.IWordService;

@Controller
public class IndexController {

	@Autowired
	private IWordService wordService;
	 
	@RequestMapping("/index")
	public String index()
	{
		return "index";
	}
	 
	@RequestMapping("/wordlist")
	public String WordList(Model model)
	{
		List<Word> list = wordService.getList();
		model.addAttribute("words", list);
		return "list";
	}
	
}
